﻿using System.IO;
using System.Web;
using System.Web.UI;

namespace Mitmar.Web.Mvc.DNN
{

    #region "IServer"
    public interface IServer
    {
        string MapPath(string virtualPath);
        void Execute(Page currentPage, StringWriter output, bool keepFormData);
    }
    #endregion

    #region "ASPServer"

    public class ASPServer : IServer
    {


        private HttpServerUtility _server = HttpContext.Current.Server;
        public void Execute(System.Web.UI.Page currentPage, System.IO.StringWriter output, bool keepFormData)
        {
            _server.Execute(currentPage, output, keepFormData);
        }

        public string MapPath(string virtualPath)
        {
            return _server.MapPath(virtualPath);
        }
    }

    #endregion


}
